{% extends base_template %}
{% load i18n %}
{% load qa_tags %}
{% load qatrack_tags %}
{% load static %}

{% block extra_report_css %}
  <style>
  </style>

{% endblock %}

{% block content %}

{# start first UTC on new page #}
<div class="page"></div>

<div id="backup-content">
{% for site, utcs in sites_data %}
  {% for utc in utcs %}
    <div class="page">
      <div class="row">
        <div class="col-xs-12">
          <dl class="dl-horizontal">
            <dt>{% trans "Unit" %}:</dt>
            <dd>{% if site %}{{ site }}{% else %}{% trans "Other" %}{% endif %} - {{ utc.unit_name }}</dd>

            {% if utc.all_lists|length > 1 %}
              <dt>{% trans "Test List Cycle" %}</dt>
              <dd><a href="{{ utc.link }}">{{ utc.name }}</a></dd>

              <dt>{% trans "Test List Members" %}</dt>
              <dd>{% for tl in utc.all_lists %}{{ tl.name }}{% if not forloop.last %}, {% endif %}{% endfor %}</dd>
            {% else %}
              <dt>{% trans "Test List" %}</dt>
              <dd><a href="{{ utc.link }}">{{ utc.name }}</a></dd>
            {% endif %}
            <dt>{% trans "Frequency" %}:</dt>
            <dd>{{ utc.frequency }}</dd>

            <dt>{% trans "Assigned To" %}:</dt>
            <dd>{{ utc.assigned_to }}</dd>

            <dt>{% trans "Visible To" %}:</dt>
            <dd>{{ utc.visible_to }}</dd>
          </dl>
          <div class="form form-inline">
            <label><strong>{% trans "Name" %}: </strong> <input class="input input-sm" type="text"/></label>
            <label class="pull-right"><strong>{% trans "Date" %}: </strong> <input class="input input-sm" type="text"/></label>
          </div>
          <div class="comment" >
            <label><strong>{% trans "Comments" %}:</strong></label>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-xs-12">
          {% for test_list in utc.all_lists %}
            <table class="table table-bordered table-striped table-condensed">
              <thead>
                <tr>
                  <th colspan="2">{% trans "Test List" %} :: {{ test_list.name }}</th>
                  <th colspan="2">
                    {% if utc.all_lists|length > 1 %}
                      {% trans "Cycle Day" %} :: {{ forloop.counter }}</th>
                    {% endif %}
                  </th>
                </tr>
                <tr>
                  <th class="test-name">{% trans "Test" %}</th>
                  <th class="test-value">{% trans "Value" %}</th>
                  <th class="test-ref">{% trans "Reference" %}</th>
                  <th class="test-tol">{% trans "Tolerance" %}</th>
                </tr>
              </thead>
              <tbody>
                {% for test, category, reference, tolerance in test_list.utis %}
                  <tr>
                    <td>{{ test }}</td>
                    <td>
                      {% if test.is_boolean %}
                        <span class="pull-left margin-l-20"> <label class="checkbox"><input type="checkbox"/> {% trans "No" %}</label></span>
                        <span class="pull-right margin-l-20"> <label class="checkbox"><input type="checkbox"/> {% trans "Yes" %}</label></span>
                      {% elif test.is_mult_choice %}
                        <div class="margin-l-20">
                          {% for choice in test.get_choices %}
                            <label class="checkbox"><input type="checkbox"/>{{choice.1}}</label>
                          {% endfor %}
                        </div>
                      {% endif %}
                    </td>
                    <td>{% if reference %}{{ reference }}{% endif %}</td>
                    <td>
                      {% tolerance_for_reference tolerance reference %}
                    </td>
                  </tr>
                {% endfor %}
              </tbody>
            </table>
          {% endfor %}
        </div>
      </div>
    </div>
  {% endfor %}
{% endfor %}
</div>
{% endblock %}
